declare global {
    interface Window {
        MathJax: any;  // Declare that window.MathJax exists (type 'any' for simplicity)
    }
}

// Configure MathJax settings by assigning to window.MathJax
window.MathJax = {
    // TeX input processor configuration
    tex: {
        // Define delimiters for inline math expressions:
        inlineMath: [
            ["$", "$"],
            ["\(", "\)"],
        ], // 行内公式选择符
        displayMath: [
            ["$$", "$$"],
            ["\[", "\]"],
        ], // 段内公式选择符
        processEnvironments: true,
        processRefs: true,
    },
    // General processing options
    options: {
        // HTML tags that MathJax should skip/ignore
        skipHtmlTags: ["script", "noscript", "style", "textarea", "pre", "code"],
        // CSS class that tells MathJax to ignore elements
        ignoreHtmlClass: "tex2jax_ignore",
        // CSS class that tells MathJax to explicitly process elements
        processHtmlClass: "tex2jax_process",
    }
};
